home *** CD-ROM | disk | FTP | other *** search
/ Motor Sport Digital Archive Collection 1960s / Motor Sport Digital Archive Collection 1960s.iso / main.swf / scripts / views / SplashImage.as < prev    next >
Encoding:
Text File  |  2008-05-21  |  13.1 KB  |  431 lines

  1. package views
  2. {
  3.    import flash.accessibility.*;
  4.    import flash.debugger.*;
  5.    import flash.display.*;
  6.    import flash.errors.*;
  7.    import flash.events.*;
  8.    import flash.external.*;
  9.    import flash.filters.*;
  10.    import flash.geom.*;
  11.    import flash.media.*;
  12.    import flash.net.*;
  13.    import flash.printing.*;
  14.    import flash.profiler.*;
  15.    import flash.system.*;
  16.    import flash.text.*;
  17.    import flash.ui.*;
  18.    import flash.utils.*;
  19.    import flash.xml.*;
  20.    import mx.binding.*;
  21.    import mx.containers.Canvas;
  22.    import mx.controls.Image;
  23.    import mx.controls.Label;
  24.    import mx.core.UIComponentDescriptor;
  25.    import mx.core.mx_internal;
  26.    import mx.events.PropertyChangeEvent;
  27.    import mx.styles.*;
  28.    
  29.    public class SplashImage extends Canvas
  30.    {
  31.       private static var _watcherSetupUtil:IWatcherSetupUtil;
  32.       
  33.       private var _bindings:Array;
  34.       
  35.       [Bindable]
  36.       private var _1850815144splashString:String;
  37.       
  38.       public var _bindingsByDestination:Object;
  39.       
  40.       [Bindable]
  41.       private var _607087478_Image2:Image;
  42.       
  43.       [Bindable]
  44.       private var _903579360shadow:Canvas;
  45.       
  46.       [Bindable]
  47.       private var _174950364splashImg:Image;
  48.       
  49.       [Bindable]
  50.       private var _199389162bgImage:String;
  51.       
  52.       [Bindable]
  53.       private var _607087479_Image3:Image;
  54.       
  55.       public var _bindingsBeginWithWord:Object;
  56.       
  57.       [Bindable]
  58.       private var _681920764_Label1:Label;
  59.       
  60.       private var tagline:Class;
  61.       
  62.       private var mainLogo:Class;
  63.       
  64.       [Bindable]
  65.       private var _681920765_Label2:Label;
  66.       
  67.       private var _watchers:Array;
  68.       
  69.       private var _documentDescriptor_:UIComponentDescriptor;
  70.       
  71.       public function SplashImage()
  72.       {
  73.          _documentDescriptor_ = new UIComponentDescriptor({
  74.             "type":Canvas,
  75.             "propertiesFactory":function():Object
  76.             {
  77.                return {"childDescriptors":[new UIComponentDescriptor({
  78.                   "type":Canvas,
  79.                   "id":"shadow",
  80.                   "stylesFactory":function():void
  81.                   {
  82.                      this.backgroundColor = 0;
  83.                   },
  84.                   "propertiesFactory":function():Object
  85.                   {
  86.                      return {
  87.                         "x":2,
  88.                         "y":2,
  89.                         "width":720,
  90.                         "height":720
  91.                      };
  92.                   }
  93.                }),new UIComponentDescriptor({
  94.                   "type":Image,
  95.                   "id":"splashImg",
  96.                   "events":{"init":"__splashImg_init"},
  97.                   "propertiesFactory":function():Object
  98.                   {
  99.                      return {
  100.                         "x":0,
  101.                         "y":0,
  102.                         "width":720,
  103.                         "height":720
  104.                      };
  105.                   }
  106.                }),new UIComponentDescriptor({
  107.                   "type":Image,
  108.                   "id":"_Image2",
  109.                   "stylesFactory":function():void
  110.                   {
  111.                      this.horizontalCenter = 0;
  112.                   },
  113.                   "propertiesFactory":function():Object
  114.                   {
  115.                      return {"y":0};
  116.                   }
  117.                }),new UIComponentDescriptor({
  118.                   "type":Image,
  119.                   "id":"_Image3",
  120.                   "propertiesFactory":function():Object
  121.                   {
  122.                      return {
  123.                         "x":462,
  124.                         "y":655
  125.                      };
  126.                   }
  127.                }),new UIComponentDescriptor({
  128.                   "type":Label,
  129.                   "id":"_Label1",
  130.                   "stylesFactory":function():void
  131.                   {
  132.                      this.letterSpacing = -5;
  133.                      this.kerning = true;
  134.                   },
  135.                   "propertiesFactory":function():Object
  136.                   {
  137.                      return {
  138.                         "x":451,
  139.                         "y":549,
  140.                         "styleName":"splashStringDk",
  141.                         "alpha":0.45
  142.                      };
  143.                   }
  144.                }),new UIComponentDescriptor({
  145.                   "type":Label,
  146.                   "id":"_Label2",
  147.                   "stylesFactory":function():void
  148.                   {
  149.                      this.letterSpacing = -5;
  150.                      this.kerning = true;
  151.                   },
  152.                   "propertiesFactory":function():Object
  153.                   {
  154.                      return {
  155.                         "x":449,
  156.                         "y":547,
  157.                         "styleName":"splashStringLt",
  158.                         "alpha":0.9
  159.                      };
  160.                   }
  161.                })]};
  162.             }
  163.          });
  164.          mainLogo = SplashImage_mainLogo;
  165.          tagline = SplashImage_tagline;
  166.          super();
  167.          mx_internal::_document = this;
  168.          if(!this.styleDeclaration)
  169.          {
  170.             this.styleDeclaration = new CSSStyleDeclaration();
  171.          }
  172.          this.styleDeclaration.defaultFactory = function():void
  173.          {
  174.             this.horizontalCenter = 0;
  175.             this.verticalCenter = 0;
  176.          };
  177.       }
  178.       
  179.       public static function set watcherSetupUtil(param1:IWatcherSetupUtil) : void
  180.       {
  181.          SplashImage._watcherSetupUtil = param1;
  182.       }
  183.       
  184.       [Bindable(event="propertyChange")]
  185.       public function get bgImage() : String
  186.       {
  187.          return this._199389162bgImage;
  188.       }
  189.       
  190.       [Bindable(event="propertyChange")]
  191.       public function get splashImg() : Image
  192.       {
  193.          return this._174950364splashImg;
  194.       }
  195.       
  196.       public function set bgImage(param1:String) : void
  197.       {
  198.          var _loc2_:Object = null;
  199.          _loc2_ = this._199389162bgImage;
  200.          if(_loc2_ !== param1)
  201.          {
  202.             this._199389162bgImage = param1;
  203.             dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"bgImage",_loc2_,param1));
  204.          }
  205.       }
  206.       
  207.       private function _SplashImage_bindingExprs() : void
  208.       {
  209.          var _loc1_:* = undefined;
  210.          _loc1_ = [new GlowFilter(0,0.5,10,10),new DropShadowFilter(5,180,0,0.5)];
  211.          _loc1_ = "images/" + bgImage;
  212.          _loc1_ = mainLogo;
  213.          _loc1_ = tagline;
  214.          _loc1_ = splashString;
  215.          _loc1_ = splashString;
  216.       }
  217.       
  218.       [Bindable(event="propertyChange")]
  219.       public function get _Label2() : Label
  220.       {
  221.          return this._681920765_Label2;
  222.       }
  223.       
  224.       private function imageInit(param1:Event) : void
  225.       {
  226.          shadow.width = splashImg.width = splashImg.contentWidth;
  227.          shadow.height = splashImg.height = splashImg.contentHeight;
  228.          this.visible = true;
  229.       }
  230.       
  231.       [Bindable(event="propertyChange")]
  232.       public function get _Label1() : Label
  233.       {
  234.          return this._681920764_Label1;
  235.       }
  236.       
  237.       [Bindable(event="propertyChange")]
  238.       public function get shadow() : Canvas
  239.       {
  240.          return this._903579360shadow;
  241.       }
  242.       
  243.       [Bindable(event="propertyChange")]
  244.       public function get splashString() : String
  245.       {
  246.          return this._1850815144splashString;
  247.       }
  248.       
  249.       public function set _Label1(param1:Label) : void
  250.       {
  251.          var _loc2_:Object = null;
  252.          _loc2_ = this._681920764_Label1;
  253.          if(_loc2_ !== param1)
  254.          {
  255.             this._681920764_Label1 = param1;
  256.             dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"_Label1",_loc2_,param1));
  257.          }
  258.       }
  259.       
  260.       public function set _Label2(param1:Label) : void
  261.       {
  262.          var _loc2_:Object = null;
  263.          _loc2_ = this._681920765_Label2;
  264.          if(_loc2_ !== param1)
  265.          {
  266.             this._681920765_Label2 = param1;
  267.             dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"_Label2",_loc2_,param1));
  268.          }
  269.       }
  270.       
  271.       public function set shadow(param1:Canvas) : void
  272.       {
  273.          var _loc2_:Object = null;
  274.          _loc2_ = this._903579360shadow;
  275.          if(_loc2_ !== param1)
  276.          {
  277.             this._903579360shadow = param1;
  278.             dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"shadow",_loc2_,param1));
  279.          }
  280.       }
  281.       
  282.       public function set splashString(param1:String) : void
  283.       {
  284.          var _loc2_:Object = null;
  285.          _loc2_ = this._1850815144splashString;
  286.          if(_loc2_ !== param1)
  287.          {
  288.             this._1850815144splashString = param1;
  289.             dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"splashString",_loc2_,param1));
  290.          }
  291.       }
  292.       
  293.       public function set _Image3(param1:Image) : void
  294.       {
  295.          var _loc2_:Object = null;
  296.          _loc2_ = this._607087479_Image3;
  297.          if(_loc2_ !== param1)
  298.          {
  299.             this._607087479_Image3 = param1;
  300.             dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"_Image3",_loc2_,param1));
  301.          }
  302.       }
  303.       
  304.       public function set _Image2(param1:Image) : void
  305.       {
  306.          var _loc2_:Object = null;
  307.          _loc2_ = this._607087478_Image2;
  308.          if(_loc2_ !== param1)
  309.          {
  310.             this._607087478_Image2 = param1;
  311.             dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"_Image2",_loc2_,param1));
  312.          }
  313.       }
  314.       
  315.       private function _SplashImage_bindingsSetup() : void
  316.       {
  317.          var binding:Binding = null;
  318.          if(!_bindings)
  319.          {
  320.             _bindings = [];
  321.          }
  322.          if(!_watchers)
  323.          {
  324.             _watchers = [];
  325.          }
  326.          binding = new Binding(this,function():Array
  327.          {
  328.             return [new GlowFilter(0,0.5,10,10),new DropShadowFilter(5,180,0,0.5)];
  329.          },function(param1:Array):void
  330.          {
  331.             shadow.filters = param1;
  332.          },"shadow.filters");
  333.          _bindings[0] = binding;
  334.          binding = new Binding(this,function():Object
  335.          {
  336.             return "images/" + bgImage;
  337.          },function(param1:Object):void
  338.          {
  339.             splashImg.source = param1;
  340.          },"splashImg.source");
  341.          _bindings[1] = binding;
  342.          binding = new Binding(this,function():Object
  343.          {
  344.             return mainLogo;
  345.          },function(param1:Object):void
  346.          {
  347.             _Image2.source = param1;
  348.          },"_Image2.source");
  349.          _bindings[2] = binding;
  350.          binding = new Binding(this,function():Object
  351.          {
  352.             return tagline;
  353.          },function(param1:Object):void
  354.          {
  355.             _Image3.source = param1;
  356.          },"_Image3.source");
  357.          _bindings[3] = binding;
  358.          binding = new Binding(this,function():String
  359.          {
  360.             var _loc1_:* = undefined;
  361.             var _loc2_:* = undefined;
  362.             _loc1_ = splashString;
  363.             return _loc1_ == undefined ? null : String(_loc1_);
  364.          },function(param1:String):void
  365.          {
  366.             _Label1.text = param1;
  367.          },"_Label1.text");
  368.          _bindings[4] = binding;
  369.          binding = new Binding(this,function():String
  370.          {
  371.             var _loc1_:* = undefined;
  372.             var _loc2_:* = undefined;
  373.             _loc1_ = splashString;
  374.             return _loc1_ == undefined ? null : String(_loc1_);
  375.          },function(param1:String):void
  376.          {
  377.             _Label2.text = param1;
  378.          },"_Label2.text");
  379.          _bindings[5] = binding;
  380.       }
  381.       
  382.       [Bindable(event="propertyChange")]
  383.       public function get _Image3() : Image
  384.       {
  385.          return this._607087479_Image3;
  386.       }
  387.       
  388.       [Bindable(event="propertyChange")]
  389.       public function get _Image2() : Image
  390.       {
  391.          return this._607087478_Image2;
  392.       }
  393.       
  394.       override public function initialize() : void
  395.       {
  396.          var target:SplashImage = null;
  397.          var watcherSetupUtilClass:Object = null;
  398.          mx_internal::setDocumentDescriptor(_documentDescriptor_);
  399.          _SplashImage_bindingsSetup();
  400.          target = this;
  401.          if(_watcherSetupUtil == null)
  402.          {
  403.             watcherSetupUtilClass = getDefinitionByName("_views_SplashImageWatcherSetupUtil");
  404.             watcherSetupUtilClass["init"](null);
  405.          }
  406.          _watcherSetupUtil.setup(this,function(param1:String):*
  407.          {
  408.             return target[param1];
  409.          },_bindings,_watchers);
  410.          super.initialize();
  411.       }
  412.       
  413.       public function __splashImg_init(param1:Event) : void
  414.       {
  415.          imageInit(param1);
  416.       }
  417.       
  418.       public function set splashImg(param1:Image) : void
  419.       {
  420.          var _loc2_:Object = null;
  421.          _loc2_ = this._174950364splashImg;
  422.          if(_loc2_ !== param1)
  423.          {
  424.             this._174950364splashImg = param1;
  425.             dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"splashImg",_loc2_,param1));
  426.          }
  427.       }
  428.    }
  429. }
  430.  
  431.